/***年计划引入--基础选择年计划 只取billId & billNo的弹窗 */

<template>
   <div>
        <el-input v-model="billObj.annualDemandPlanBillNo" readonly>
            <i slot="suffix" class="el-input__icon el-icon-document-copy"  @click="clickSelecYear" ></i>

        </el-input>
        <span class="a" style="width: 100px"
            @click="clickToYearNeedPlan"
        >查看</span>
   </div>
</template>

<script>
import {  introducePlan } from '@/api/turnover/ppw.js'

export default {
    props: {
        billObj: {
            type: Object,
            default: ()=>{
                return {}
            }
        }
    },
    data () {

    },
    methods: {
        async clickSelecYear () {
            const obj = await introducePlan()
            this.annualDemandPlanBillNo = obj.billNo
            this.annualDemandPlanBillId = obj.billId

            this.$emit('yearPlanObj', obj)
        },
        clickToYearNeedPlan () {
            let billid = this.billObj.annualDemandPlanBillId
            console.log('billid: ', billid)
            if(!billid) return
            this.$router.replace({
                path: '/yearNeedPlanShow',
                query: {
                    billid,
                    isShow: 'isShow'
                }
            })
        },
    }
}
</script>

<style lang="scss" scoped>

</style>